import React from 'react'
import Css from '../style/common.module.css'


class Danqu extends React.Component {
  constructor(){
    super()
    this.state={
      arr:[]
    }
  }
componentWillMount(){
    // console.log(this.props)
    let {name}=this.props
    fetch(`http://106.12.79.128:666/search?keywords=${name}&type=1009`)
    .then(body=>body.json())
    .then(res=>{
        // console.log(res.result.artists)
        this.setState({
          arr:res.result.djRadios
        })
    })
}
  render() {
    return (
        <div>
            {this.state.arr.map((item,index)=>{
                return( 
                    <div>
                        <div className={Css.zjList}>
                            <img src={item.dj.avatarUrl} alt="" className={Css.zjImg}/>
                            <div className={Css.zjP}>
                                <p className={Css.zjP1}>{item.name}</p>
                                <p className={Css.zjP2}>{item.dj.nickname}</p>
                            </div>
                        </div>
                    </div>
                )
            })
            }
        </div>
    );
  }
}

export default Danqu